Integrand size = 19, antiderivative size = 161 \[ \int \cos (c+d x) (a+b \tan (c+d x))^n \, dx=\frac {\operatorname {AppellF1}\left (1+n,\frac {3}{2},\frac {3}{2},2+n,\frac {a+b \tan (c+d x)}{a-\sqrt {-b^2}},\frac {a+b \tan (c+d x)}{a+\sqrt {-b^2}}\right ) \cos ^3(c+d x) (a+b \tan (c+d x))^{1+n} \left (1-\frac {a+b \tan (c+d x)}{a-\sqrt {-b^2}}\right )^{3/2} \left (1-\frac {a+b \tan (c+d x)}{a+\sqrt {-b^2}}\right )^{3/2}}{b d (1+n)} \]
[Out]
Time = 0.18 (sec) , antiderivative size = 161, normalized size of antiderivative = 1.00, number of steps used = 3, number of rules used = 3, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.158, Rules used = {3593, 774, 138} \[ \int \cos (c+d x) (a+b \tan (c+d x))^n \, dx=\frac {\cos ^3(c+d x) \left (1-\frac {a+b \tan (c+d x)}{a-\sqrt {-b^2}}\right )^{3/2} \left (1-\frac {a+b \tan (c+d x)}{a+\sqrt {-b^2}}\right )^{3/2} (a+b \tan (c+d x))^{n+1} \operatorname {AppellF1}\left (n+1,\frac {3}{2},\frac {3}{2},n+2,\frac {a+b \tan (c+d x)}{a-\sqrt {-b^2}},\frac {a+b \tan (c+d x)}{a+\sqrt {-b^2}}\right )}{b d (n+1)} \]
[In]
[Out]
Rule 138
Rule 774
Rule 3593
Rubi steps \begin{align*} \text {integral}& = \frac {\left (\cos (c+d x) \sqrt {\sec ^2(c+d x)}\right ) \text {Subst}\left (\int \frac {(a+x)^n}{\left (1+\frac {x^2}{b^2}\right )^{3/2}} \, dx,x,b \tan (c+d x)\right )}{b d} \\ & = \frac {\left (\cos ^3(c+d x) \left (1-\frac {a+b \tan (c+d x)}{a-\frac {b^2}{\sqrt {-b^2}}}\right )^{3/2} \left (1-\frac {a+b \tan (c+d x)}{a+\frac {b^2}{\sqrt {-b^2}}}\right )^{3/2}\right ) \text {Subst}\left (\int \frac {x^n}{\left (1-\frac {x}{a-\sqrt {-b^2}}\right )^{3/2} \left (1-\frac {x}{a+\sqrt {-b^2}}\right )^{3/2}} \, dx,x,a+b \tan (c+d x)\right )}{b d} \\ & = \frac {\operatorname {AppellF1}\left (1+n,\frac {3}{2},\frac {3}{2},2+n,\frac {a+b \tan (c+d x)}{a-\sqrt {-b^2}},\frac {a+b \tan (c+d x)}{a+\sqrt {-b^2}}\right ) \cos ^3(c+d x) (a+b \tan (c+d x))^{1+n} \left (1-\frac {a+b \tan (c+d x)}{a-\sqrt {-b^2}}\right )^{3/2} \left (1-\frac {a+b \tan (c+d x)}{a+\sqrt {-b^2}}\right )^{3/2}}{b d (1+n)} \\ \end{align*}
Result contains complex when optimal does not.
Time = 6.57 (sec) , antiderivative size = 341, normalized size of antiderivative = 2.12 \[ \int \cos (c+d x) (a+b \tan (c+d x))^n \, dx=\frac {2 \left (a^2+b^2\right )^2 (2+n) \operatorname {AppellF1}\left (1+n,\frac {3}{2},\frac {3}{2},2+n,\frac {a+b \tan (c+d x)}{a-i b},\frac {a+b \tan (c+d x)}{a+i b}\right ) \cos ^5(c+d x) (-i+\tan (c+d x)) (i+\tan (c+d x)) (a+b \tan (c+d x))^{1+n}}{(a-i b) (a+i b) b d (1+n) \left (2 \left (a^2+b^2\right ) (2+n) \operatorname {AppellF1}\left (1+n,\frac {3}{2},\frac {3}{2},2+n,\frac {a+b \tan (c+d x)}{a-i b},\frac {a+b \tan (c+d x)}{a+i b}\right )+3 \left ((a-i b) \operatorname {AppellF1}\left (2+n,\frac {3}{2},\frac {5}{2},3+n,\frac {a+b \tan (c+d x)}{a-i b},\frac {a+b \tan (c+d x)}{a+i b}\right )+(a+i b) \operatorname {AppellF1}\left (2+n,\frac {5}{2},\frac {3}{2},3+n,\frac {a+b \tan (c+d x)}{a-i b},\frac {a+b \tan (c+d x)}{a+i b}\right )\right ) (a+b \tan (c+d x))\right )} \]
[In]
[Out]
\[\int \cos \left (d x +c \right ) \left (a +b \tan \left (d x +c \right )\right )^{n}d x\]
[In]
[Out]
\[ \int \cos (c+d x) (a+b \tan (c+d x))^n \, dx=\int { {\left (b \tan \left (d x + c\right ) + a\right )}^{n} \cos \left (d x + c\right ) \,d x } \]
[In]
[Out]
\[ \int \cos (c+d x) (a+b \tan (c+d x))^n \, dx=\int \left (a + b \tan {\left (c + d x \right )}\right )^{n} \cos {\left (c + d x \right )}\, dx \]
[In]
[Out]
\[ \int \cos (c+d x) (a+b \tan (c+d x))^n \, dx=\int { {\left (b \tan \left (d x + c\right ) + a\right )}^{n} \cos \left (d x + c\right ) \,d x } \]
[In]
[Out]
\[ \int \cos (c+d x) (a+b \tan (c+d x))^n \, dx=\int { {\left (b \tan \left (d x + c\right ) + a\right )}^{n} \cos \left (d x + c\right ) \,d x } \]
[In]
[Out]
Timed out. \[ \int \cos (c+d x) (a+b \tan (c+d x))^n \, dx=\int \cos \left (c+d\,x\right )\,{\left (a+b\,\mathrm {tan}\left (c+d\,x\right )\right )}^n \,d x \]
[In]
[Out]